<template>
  <div>
    <van-nav-bar
      title="乐购"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-cell-group>
      <p>意见反馈</p>
      <van-field
        v-model="message"
        rows="2"
        autosize
        label="留言"
        type="textarea"
        maxlength="50"
        placeholder="请填写你的意见和反馈"
        show-word-limit
      />
      <van-field
        v-model="text"
        label="联系方式"
        placeholder="邮箱/手机号/微信号"
      />
    </van-cell-group>
    <van-button @click="submit" type="danger" size="large">提交</van-button>
  </div>
</template>

<script>
import { submitAction } from "@/api/mine";
export default {
  data() {
    return {
      // value: "",
      text: "",
      message: "",
    };
  },
  created() {},
  mounted() {},
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    async submit() {
      var res = await submitAction({
        content: this.message,
        openId: localStorage.getItem("openId"),
        name: localStorage.getItem('name'),
        // name: localStorage.getItem("nickName",JSON.stringify(nickName)),
        phone: this.text,
      }).then((res) => {
        console.log(res);
        this.value='';
        this.message='';
         this.text=''
      });
    },
  },
};
</script>
<style lang="scss">
    p{
        text-align: left-end;
    }
</style>